package org.cos.generation.util.symbol;

import org.cos.generation.util.predict.PredictSet;
import org.eclipse.jdt.core.dom.Type;

/**
 *
 * @author ZXD
 */
public class SymbolElem {

	public enum SymbolKind {
	    BOOLEAN,
	    BYTE,
	    SHORT,
	    INT,
	    LONG,
	    CHAR,
	    FLOAT,
	    DOUBLE,
	    STRING,
	    REF;
	    
	    public static SymbolKind valueOf(Type type) {
	        String typeName = type.toString();
	        if (typeName.equals("boolean")) return BOOLEAN;
	        if (typeName.equals("byte")) return BYTE;
	        if (typeName.equals("short")) return SHORT;
	        if (typeName.equals("int")) return INT;
	        if (typeName.equals("long")) return LONG;
	        if (typeName.equals("char")) return CHAR;
	        if (typeName.equals("float")) return FLOAT;
	        if (typeName.equals("double")) return DOUBLE;
	        if (typeName.equals("String")) return STRING;
	        return REF;
	    }
	}
	
    private SymbolKind kind;

    private PredictSet poss;

    public SymbolElem(SymbolKind kind) {
        this.kind = kind;
    }

    public SymbolKind getKind() {
        return kind;
    }

    public PredictSet getPoss() {
        return poss;
    }
    
    public void setPoss(PredictSet poss) {
    	this.poss = poss;
    }
    
}